home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1988-02-13 | 26.3 KB | 797 lines |
- IMPLEMENTATION MODULE Window;
-
-
- (*$S-,$T- turn off stack and range checking *)
-
- FROM SYSTEM IMPORT ADR, ADDRESS;
- IMPORT GEMVDIbase;
- IMPORT VDIAttribs;
- IMPORT VDIControls;
- IMPORT VDIOutputs;
- IMPORT GEMAESbase;
- IMPORT AESForms;
- IMPORT AESGraphics;
- IMPORT AESWindows;
- IMPORT Math;
- IMPORT Text;
- IMPORT Screen;
- IMPORT Icon;
-
-
- CONST
- NoWindowLine1 = "[3][No more windows are available.|Before you open a desk|";
- NoWindowLine2 = "accessory, close a window|that you are no longer using.][ OK ]";
-
- VAR WindowList : InformationPtr;
-
- (* Contains pointer to linked list of window information *)
- (* records. *)
-
- (********************************************************************)
-
- PROCEDURE ScreenPointToWindowPoint (
- ScreenPoint : Screen.PixelCoordinate;
- WindowOrigin : Screen.PixelCoordinate;
- ScreenOrigin : PixelCoordinate;
- VAR WindowPoint : PixelCoordinate );
-
- BEGIN
- WindowPoint.X := ScreenPoint.X - WindowOrigin.X + ScreenOrigin.X;
- WindowPoint.Y := ScreenPoint.Y - WindowOrigin.Y + ScreenOrigin.Y;
- END ScreenPointToWindowPoint;
-
- (********************************************************************)
-
- PROCEDURE WindowPointToScreenPoint (
- WindowPoint : PixelCoordinate;
- ScreenOrigin : PixelCoordinate;
- WindowOrigin : Screen.PixelCoordinate;
- VAR ScreenPoint : Screen.PixelCoordinate );
-
- BEGIN
- ScreenPoint.X := WindowPoint.X - ScreenOrigin.X + WindowOrigin.X;
- ScreenPoint.Y := WindowPoint.Y - ScreenOrigin.Y + WindowOrigin.Y;
- END WindowPointToScreenPoint;
-
- (********************************************************************)
-
- PROCEDURE ScreenBoxToWindowBox (
- ScreenBox : Screen.Box;
- WindowOrigin : Screen.PixelCoordinate;
- ScreenOrigin : PixelCoordinate;
- VAR WindowBox : Box );
-
- BEGIN
- ScreenPointToWindowPoint (
- ScreenBox.Origin, WindowOrigin, ScreenOrigin, WindowBox.Origin );
- WindowBox.Size.Width := ScreenBox.Size.Width;
- WindowBox.Size.Height := ScreenBox.Size.Height;
- END ScreenBoxToWindowBox;
-
- (********************************************************************)
-
- PROCEDURE WindowBoxToScreenBox (
- WindowBox : Box;
- ScreenOrigin : PixelCoordinate;
- WindowOrigin : Screen.PixelCoordinate;
- VAR ScreenBox : Screen.Box );
-
- BEGIN
- WindowPointToScreenPoint (
- WindowBox.Origin, ScreenOrigin, WindowOrigin, ScreenBox.Origin );
- ScreenBox.Size.Width := WindowBox.Size.Width;
- ScreenBox.Size.Height := WindowBox.Size.Height;
- END WindowBoxToScreenBox;
-
- (********************************************************************)
-
- PROCEDURE ContainsPoint ( Point : PixelCoordinate;
- Region : Box ) : BOOLEAN;
-
- BEGIN
- RETURN ((Point.X >= Region.Origin.X) AND
- (Point.Y >= Region.Origin.Y) AND
- (Point.X < Region.Origin.X + Region.Size.Width) AND
- (Point.Y < Region.Origin.Y + Region.Size.Height));
- END ContainsPoint;
-
- (********************************************************************)
-
- PROCEDURE Intersected ( Region1 : Box;
- Region2 : Box;
- VAR Result : Box ) : BOOLEAN;
-
- VAR TempResult : Box;
-
- BEGIN
- TempResult.Origin.X :=
- Math.Max ( Region1.Origin.X, Region2.Origin.X );
- TempResult.Origin.Y :=
- Math.Max ( Region1.Origin.Y, Region2.Origin.Y );
- TempResult.Size.Width :=
- Math.Min ( Region1.Size.Width + Region1.Origin.X,
- Region2.Size.Width + Region2.Origin.X ) -
- TempResult.Origin.X;
- TempResult.Size.Height :=
- Math.Min ( Region1.Size.Height + Region1.Origin.Y,
- Region2.Size.Height + Region2.Origin.Y ) -
- TempResult.Origin.Y;
- Result := TempResult;
- RETURN ((Result.Size.Width > 0) AND (Result.Size.Height > 0));
- END Intersected;
-
- (********************** LOCAL ROUTINE *******************************)
-
- PROCEDURE SetHorizSliderSize ( TargetWindow : InformationPtr );
-
- VAR SliderSize : INTEGER;
-
- BEGIN
- WITH TargetWindow^ DO
- IF VirtualRegionSize.Width <> 0 THEN
- SliderSize := INTEGER (
- LONGINT (WorkRegion.Size.Width) *
- LONGINT (1000) DIV
- LONGINT (VirtualRegionSize.Width));
- AESWindows.WindowSet (
- Id,
- GEMAESbase.HorizSliderSize,
- SliderSize, 0, 0, 0 );
- END;
- END;
- END SetHorizSliderSize;
-
- (************************** LOCAL ROUTINE ***************************)
-
- PROCEDURE SetHorizSliderPosition ( TargetWindow : InformationPtr );
-
- VAR SliderPosition : INTEGER;
-
- BEGIN
- WITH TargetWindow^ DO
- IF VirtualRegionSize.Width <> 0 THEN
- SliderPosition := INTEGER (
- LONGINT (VirtualOrigin.X) *
- LONGINT (1000) DIV
- LONGINT (VirtualRegionSize.Width));
- AESWindows.WindowSet (
- Id,
- GEMAESbase.WindowHorizSlide,
- SliderPosition,
- 0, 0, 0 );
- END;
- END;
- END SetHorizSliderPosition;
-
- (************************** LOCAL ROUTINE ***************************)
-
- PROCEDURE SetVertSliderSize ( TargetWindow : InformationPtr );
-
- VAR SliderSize : INTEGER;
-
- BEGIN
- WITH TargetWindow^ DO
- IF VirtualRegionSize.Height <> 0 THEN
- SliderSize := INTEGER (
- LONGINT (WorkRegion.Size.Height) *
- LONGINT (1000) DIV
- LONGINT (VirtualRegionSize.Height));
- AESWindows.WindowSet (
- Id,
- GEMAESbase.VertSliderSize,
- SliderSize, 0, 0, 0 );
- END;
- END;
- END SetVertSliderSize;
-
- (************************** LOCAL ROUTINE ***************************)
-
- PROCEDURE SetVertSliderPosition ( TargetWindow : InformationPtr );
-
- VAR SliderPosition : INTEGER;
-
- BEGIN
- WITH TargetWindow^ DO
- IF VirtualRegionSize.Height <> 0 THEN
- SliderPosition := INTEGER (
- LONGINT (VirtualOrigin.Y) *
- LONGINT (1000) DIV
- LONGINT (VirtualRegionSize.Height));
- AESWindows.WindowSet (
- Id,
- GEMAESbase.WindowVertSlide,
- SliderPosition,
- 0, 0, 0 );
- END;
- END;
- END SetVertSliderPosition;
-
- (********************************************************************)
-
- PROCEDURE Find ( WindowId : INTEGER;
- VAR WindowPtr : InformationPtr ) : BOOLEAN;
-
- BEGIN
- WindowPtr := WindowList;
- WHILE (WindowPtr <> NIL) AND (WindowPtr^.Id <> WindowId) DO
- WindowPtr := WindowPtr^.Successor;
- END;
- RETURN (WindowPtr <> NIL);
- END Find;
-
- (********************************************************************)
-
- PROCEDURE Open (
- GrowFromBox : Screen.Box;
- WindowPtr : InformationPtr;
- WindowName : Text.String80;
- WindowInformationLine : Text.String80;
- WindowRegion : Screen.Box;
- WindowVirtualRegionSize : Area;
- WindowComponents : INTEGER;
- WindowFillStyle : INTEGER;
- WindowFillIndex : INTEGER;
- WindowContents : INTEGER;
- WindowRedrawRoutine : RedrawRoutineType ) : BOOLEAN;
-
- VAR OpenStatus : BOOLEAN;
-
- BEGIN
- OpenStatus := TRUE; (* Hope that the window can open OK *)
- AESGraphics.GrafMouse ( GEMAESbase.MouseOff, 0 );
-
- (*--- Initialize the data fields of the window to be created ----*)
-
- WITH WindowPtr^ DO
- Name := WindowName;
- InformationLine := WindowInformationLine;
- Components := WindowComponents;
- WorkRegion := WindowRegion;
- AESWindows.WindowCalc (
- GEMAESbase.WCBorder,
- Components,
- WindowRegion.Origin.X,
- WindowRegion.Origin.Y,
- WindowRegion.Size.Width,
- WindowRegion.Size.Height,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height );
- BackdropFillStyle := WindowFillStyle;
- BackdropFillIndex := WindowFillIndex;
- BackdropContents := WindowContents;
- VirtualRegionSize := WindowVirtualRegionSize;
- VirtualOrigin.X := 0;
- VirtualOrigin.Y := 0;
- RedrawRoutine := WindowRedrawRoutine;
-
- (*--- Create the new window ----------------------------------*)
-
- Id := AESWindows.WindowCreate (
- Components,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height );
- IF Id < 0 THEN
- OpenStatus := FALSE;
- ELSE
- IF WindowList <> NIL THEN
- WindowList^.Predecessor := WindowPtr;
- END;
- Successor := WindowList;
- Predecessor := NIL;
- WindowList := WindowPtr;
- AESWindows.WindowSet (
- Id,
- GEMAESbase.WindowName,
- INTEGER (ADR (Name) DIV 10000H),
- INTEGER (ADR (Name) MOD 10000H),
- 0, 0 );
- AESWindows.WindowSet (
- Id,
- GEMAESbase.WindowInfo,
- INTEGER (ADR (InformationLine) DIV 10000H),
- INTEGER (ADR (InformationLine) MOD 10000H),
- 0, 0 );
- SetHorizSliderSize ( WindowPtr );
- SetVertSliderSize ( WindowPtr );
- IF BackdropContents >= 0 THEN
- Icon.SetOrigin ( BackdropContents, 0, WorkRegion.Origin );
- END;
-
- (*--- Display the new window on the screen ----------------*)
-
- AESGraphics.GrafGrowBox (
- GrowFromBox.Origin.X,
- GrowFromBox.Origin.Y,
- GrowFromBox.Size.Width,
- GrowFromBox.Size.Height,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height );
- AESWindows.WindowOpen (
- Id,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height );
- END;
- END;
- AESGraphics.GrafMouse ( GEMAESbase.MouseOn, 0 );
- RETURN (OpenStatus);
- END Open;
-
- (********************************************************************)
-
- PROCEDURE Redraw ( WindowId : INTEGER;
- Region : Screen.Box );
-
- CONST ClippingOn = 1;
-
- VAR
- TargetWindow : InformationPtr;
- WindowRectangle : Screen.Box;
- UpdateBox : Screen.Box;
- FillStyle : INTEGER;
- FillIndex : INTEGER;
- PxyArray : GEMVDIbase.PxyArrayType;
- PreviousRegion : Screen.Box;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
-
- (*--- Window belongs to application, so redraw it ------------*)
-
- AESGraphics.GrafMouse ( GEMAESbase.MouseOff, 0 );
- AESWindows.WindowUpdate ( GEMAESbase.BeginUpdate );
- WITH TargetWindow^ DO
- AESWindows.WindowGet (
- Id,
- GEMAESbase.FirstXYWH,
- WindowRectangle.Origin.X,
- WindowRectangle.Origin.Y,
- WindowRectangle.Size.Width,
- WindowRectangle.Size.Height );
- WHILE (WindowRectangle.Size.Width <> 0) AND
- (WindowRectangle.Size.Height <> 0) DO
-
- (*--- Interate through the update rectangles ------------*)
-
- IF Screen.Intersection (
- Region,
- WindowRectangle,
- UpdateBox ) AND
- Screen.Intersection (
- Screen.WorkSpace,
- UpdateBox,
- UpdateBox ) THEN
-
- (*--- "White Out" the area to be redrawn -------------*)
-
- FillStyle := VDIAttribs.SetFillInteriorStyle (
- Screen.VirtualHandle, BackdropFillStyle );
- FillIndex := VDIAttribs.SetFillStyle (
- Screen.VirtualHandle, BackdropFillIndex );
- PxyArray[0] := UpdateBox.Origin.X;
- PxyArray[1] := UpdateBox.Origin.Y;
- PxyArray[2] := PxyArray[0] + UpdateBox.Size.Width - 1;
- PxyArray[3] := PxyArray[1] + UpdateBox.Size.Height - 1;
- VDIControls.SetClipping (
- Screen.VirtualHandle, ClippingOn, PxyArray );
- VDIOutputs.FillRectangle (
- Screen.VirtualHandle, PxyArray );
- IF BackdropContents >= 0 THEN
- Icon.GetRegion ( BackdropContents, 0, PreviousRegion );
- Icon.SetOrigin ( BackdropContents, 0, WorkRegion.Origin );
- Icon.Display ( BackdropContents, 0, UpdateBox );
- Icon.SetOrigin ( BackdropContents, 0, PreviousRegion.Origin );
- END;
-
- (*--- Call the application's redraw routine ----------*)
-
- RedrawRoutine ( UpdateBox );
- END;
-
- (*--- Get the next update rectangle ---------------------*)
-
- AESWindows.WindowGet (
- Id,
- GEMAESbase.NextXYWH,
- WindowRectangle.Origin.X,
- WindowRectangle.Origin.Y,
- WindowRectangle.Size.Width,
- WindowRectangle.Size.Height );
- END;
- AESWindows.WindowUpdate ( GEMAESbase.EndUpdate );
- AESGraphics.GrafMouse ( GEMAESbase.MouseOn, 0 );
- END;
- END;
- END Redraw;
-
- (********************************************************************)
-
- PROCEDURE Top ( WindowId : INTEGER );
-
- VAR TargetWindow : InformationPtr;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- IF BackdropContents >= 0 THEN
- Icon.SetOrigin ( BackdropContents, 0, WorkRegion.Origin );
- END;
- AESWindows.WindowSet ( Id, GEMAESbase.Top, 0, 0, 0, 0 );
- END;
- END;
- END Top;
-
- (********************************************************************)
-
- PROCEDURE Resize ( WindowId : INTEGER;
- NewSize : Screen.Box );
-
- VAR TargetWindow : InformationPtr;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- Borders := NewSize;
- AESWindows.WindowCalc (
- GEMAESbase.WCWork,
- Components,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height,
- WorkRegion.Origin.X,
- WorkRegion.Origin.Y,
- WorkRegion.Size.Width,
- WorkRegion.Size.Height );
- IF BackdropContents >= 0 THEN
- Icon.SetOrigin ( BackdropContents, 0, WorkRegion.Origin );
- END;
- AESWindows.WindowSet (
- Id,
- GEMAESbase.CurrXYWH,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height );
- SetHorizSliderSize ( TargetWindow );
- SetVertSliderSize ( TargetWindow );
- END;
- END;
- END Resize;
-
- (********************************************************************)
-
- PROCEDURE Move ( WindowId : INTEGER;
- NewOrigin : Screen.PixelCoordinate );
-
- VAR TargetWindow : InformationPtr;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- Borders.Origin := NewOrigin;
- AESWindows.WindowCalc (
- GEMAESbase.WCWork,
- Components,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height,
- WorkRegion.Origin.X,
- WorkRegion.Origin.Y,
- WorkRegion.Size.Width,
- WorkRegion.Size.Height );
- IF BackdropContents >= 0 THEN
- Icon.SetOrigin ( BackdropContents, 0, WorkRegion.Origin );
- END;
- AESWindows.WindowSet (
- Id,
- GEMAESbase.CurrXYWH,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height );
- END;
- END;
- END Move;
-
- (********************************************************************)
-
- PROCEDURE Full ( WindowId : INTEGER );
-
- VAR
- TargetWindow : InformationPtr;
- PreviousWorkBox : Screen.Box;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- IF (Borders.Size.Height = Screen.WorkSpace.Size.Height) AND
- (Borders.Size.Width = Screen.WorkSpace.Size.Width) THEN
- AESWindows.WindowGet (
- Id,
- GEMAESbase.PrevXYWH,
- PreviousWorkBox.Origin.X,
- PreviousWorkBox.Origin.Y,
- PreviousWorkBox.Size.Width,
- PreviousWorkBox.Size.Height );
- Resize ( Id, PreviousWorkBox );
- AESGraphics.GrafShrinkBox (
- Screen.WorkSpace.Origin.X,
- Screen.WorkSpace.Origin.Y,
- Screen.WorkSpace.Size.Width,
- Screen.WorkSpace.Size.Height,
- PreviousWorkBox.Origin.X,
- PreviousWorkBox.Origin.Y,
- PreviousWorkBox.Size.Width,
- PreviousWorkBox.Size.Height );
- ELSE
- AESGraphics.GrafGrowBox (
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height,
- Screen.WorkSpace.Origin.X,
- Screen.WorkSpace.Origin.Y,
- Screen.WorkSpace.Size.Width,
- Screen.WorkSpace.Size.Height );
- Resize ( Id, Screen.WorkSpace );
- END;
- END;
- END;
- END Full;
-
- (********************************************************************)
-
- PROCEDURE MoveDisplayArea ( WindowId : INTEGER;
- Direction : INTEGER );
-
- CONST
- PageUp = 0;
- PageDown = 1;
- RowUp = 2;
- RowDown = 3;
- PageLeft = 4;
- PageRight = 5;
- ColumnLeft = 6;
- ColumnRight = 7;
-
- VAR
- TargetWindow : InformationPtr;
- SliderPosition : INTEGER;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
-
- IF Direction = PageUp THEN
- VirtualOrigin.Y := Math.Max (
- VirtualOrigin.Y - WorkRegion.Size.Height - 10,
- 0 );
- SetVertSliderPosition ( TargetWindow );
-
- ELSIF Direction = PageDown THEN
- VirtualOrigin.Y := Math.Min (
- VirtualOrigin.Y + WorkRegion.Size.Height - 10,
- VirtualRegionSize.Height );
- SetVertSliderPosition ( TargetWindow );
-
- ELSIF Direction = RowUp THEN
- VirtualOrigin.Y := Math.Max (
- VirtualOrigin.Y - Screen.CharacterArea.Height,
- 0 );
- SetVertSliderPosition ( TargetWindow );
-
- ELSIF Direction = RowDown THEN
- VirtualOrigin.Y := Math.Min (
- VirtualOrigin.Y + Screen.CharacterArea.Height,
- VirtualRegionSize.Height );
- SetVertSliderPosition ( TargetWindow );
-
- ELSIF Direction = PageLeft THEN
- VirtualOrigin.X := Math.Max (
- VirtualOrigin.X - WorkRegion.Size.Width - 10,
- 0 );
- SetHorizSliderPosition ( TargetWindow );
-
- ELSIF Direction = PageRight THEN
- VirtualOrigin.X := Math.Min (
- VirtualOrigin.X + WorkRegion.Size.Width - 10,
- VirtualRegionSize.Width );
- SetHorizSliderPosition ( TargetWindow );
-
- ELSIF Direction = ColumnLeft THEN
- VirtualOrigin.X := Math.Max (
- VirtualOrigin.X - Screen.CharacterArea.Width,
- 0 );
- SetHorizSliderPosition ( TargetWindow );
-
- ELSIF Direction = ColumnRight THEN
- VirtualOrigin.X := Math.Min (
- VirtualOrigin.X + Screen.CharacterArea.Width,
- VirtualRegionSize.Width );
- SetHorizSliderPosition ( TargetWindow );
-
- END;
- Redraw ( Id, WorkRegion );
- END;
- END;
- END MoveDisplayArea;
-
- (********************************************************************)
-
- PROCEDURE MoveHorizSlider ( WindowId : INTEGER;
- NewPosition : INTEGER );
-
- VAR TargetWindow : InformationPtr;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- AESWindows.WindowSet (
- Id,
- GEMAESbase.WindowHorizSlide,
- NewPosition, 0, 0, 0 );
- VirtualOrigin.X := INTEGER (
- LONGINT (NewPosition) *
- LONGINT (VirtualRegionSize.Width) DIV
- LONGINT (1000));
- END;
- END;
- END MoveHorizSlider;
-
- (********************************************************************)
-
- PROCEDURE MoveVertSlider ( WindowId : INTEGER;
- NewPosition : INTEGER );
-
- VAR TargetWindow : InformationPtr;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- AESWindows.WindowSet (
- Id,
- GEMAESbase.WindowVertSlide,
- NewPosition, 0, 0, 0 );
- VirtualOrigin.X := INTEGER (
- LONGINT (NewPosition) *
- LONGINT (VirtualRegionSize.Height) DIV
- LONGINT (1000));
- END;
- END;
- END MoveVertSlider;
-
- (********************************************************************)
-
- PROCEDURE SetVirtualRegionSize ( WindowId : INTEGER;
- Size : Area );
-
- VAR TargetWindow : InformationPtr;
-
- CONST
- VertSlider = 8;
- HorizSlider = 11;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- VirtualRegionSize := Size;
- IF HorizSlider IN BITSET (Components) THEN
- SetHorizSliderSize ( TargetWindow );
- END;
- IF VertSlider IN BITSET (Components) THEN
- SetVertSliderSize ( TargetWindow );
- END;
- END;
- END;
- END SetVirtualRegionSize;
-
- (********************************************************************)
-
- PROCEDURE ChangeName ( WindowId : INTEGER;
- WindowName : Text.String80 );
-
- VAR TargetWindow : InformationPtr;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- Name := WindowName;
- AESWindows.WindowSet (
- Id,
- GEMAESbase.WindowName,
- INTEGER (ADR (Name) DIV 10000H),
- INTEGER (ADR (Name) MOD 10000H),
- 0, 0 );
- END;
- END;
- END ChangeName;
-
- (********************************************************************)
-
- PROCEDURE ChangeInformationLine (
- WindowId : INTEGER;
- WindowInformationLine : Text.String80 );
-
- VAR TargetWindow : InformationPtr;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- InformationLine := WindowInformationLine;
- AESWindows.WindowSet (
- Id,
- GEMAESbase.WindowInfo,
- INTEGER (ADR (InformationLine) DIV 10000H),
- INTEGER (ADR (InformationLine) MOD 10000H),
- 0, 0 );
- END;
- END;
- END ChangeInformationLine;
-
- (********************************************************************)
-
- PROCEDURE Close (
- WindowId : INTEGER;
- ShrinkToBox : Screen.Box );
-
- VAR TargetWindow : InformationPtr;
-
- BEGIN
- IF Find ( WindowId, TargetWindow ) THEN
- WITH TargetWindow^ DO
- AESWindows.WindowClose ( Id );
- AESGraphics.GrafShrinkBox (
- ShrinkToBox.Origin.X,
- ShrinkToBox.Origin.Y,
- ShrinkToBox.Size.Width,
- ShrinkToBox.Size.Height,
- Borders.Origin.X,
- Borders.Origin.Y,
- Borders.Size.Width,
- Borders.Size.Height );
- AESWindows.WindowDelete ( Id );
- Id := -1;
- IF TargetWindow = WindowList THEN
- WindowList := Successor;
- END;
- IF Successor <> NIL THEN
- Successor^.Predecessor := Predecessor;
- END;
- IF Predecessor <> NIL THEN
- Predecessor^.Successor := Successor;
- END;
- END;
- ELSIF WindowId = 0 THEN
- WindowList := NIL; (* Unconditionally delete all windows *)
- END;
- END Close;
-
- (********************************************************************)
-
- PROCEDURE Unavailable;
-
- VAR
- Buffer : ARRAY [0..400] OF CHAR;
- Success : BOOLEAN;
- ExitObject : INTEGER;
-
- BEGIN
- Buffer := NoWindowLine1;
- Success := Text.ConcatString ( Buffer, NoWindowLine2, Buffer );
- ExitObject := AESForms.FormAlert ( 1, Buffer );
- END Unavailable;
-
- BEGIN
- WindowList := NIL;
- END Window.
-
-